package cn.lzh.mapper;

import cn.lzh.entity.Book;
import cn.lzh.entity.BookType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface BookMapper {
 public List<Book> findAll();
 public  Book findById(int id);
 public void  add(Book book);
 public void update(Book b);
 public  List<Book> findPage(@Param("start") int start, @Param("num") int num, @Param("typeid") int typeid);
 public  int getCount(int typeid);

 public List<Book> findByName(@Param("name") String name, @Param("start") int start, @Param("num") int num);

 public  int getCountByName(@Param("name") String name);

  public List<Book> findSale5();
  public  List<Book> findFav5();
 public List<Book> findRate5() ;
 List<Book> findPageRate(@Param("start") int start, @Param("num") int num, @Param("typeid") int typeid);

 List<Book> findPageSale(@Param("start") int start, @Param("num") int num, @Param("typeid") int typeid);

 List<Book> findPageFav(@Param("start") int start, @Param("num") int num, @Param("typeid") int typeid);
 void addFavnum(Map<String,Object> map);


}
